package com.fxy.controller;

import com.fxy.Entity.Notice;
import com.fxy.Service.NoticeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import jdk.nashorn.internal.runtime.linker.LinkerCallSite;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
//
//@Controller
@Api("查询全部")
@RequestMapping("/list")
@RestController
public class controller {
@Autowired
private NoticeService noticeService;
    @GetMapping("/list")
    @ApiOperation(value="查询")
    public List<Notice> list(){


    List<Notice> listNotice =noticeService.list();
//        for (Notice notice : listNotice) {
//            System.out.println(listNotice);
//        }
        return listNotice;


    }
}


